<script setup>
//导入方法
import { onMounted } from 'vue';
import { useCounteStore } from './stores/counter'

const counteStore = useCounteStore()

onMounted (() => {
  counteStore.getList()
})

// function login() {
//   if(list.length !== 0){
//     console.log('登录成功')
//   }else{
//     console.log('登录失败')
//   }
// }

function w() {
  counteStore.increment()

console.log(counteStore.list)
}


</script>

<template>

  <div>

    <div>
      <button @click='w'>{{ counteStore.count }}</button>

      {{ counteStore.doubleCount }}

      <ul>
        <li v-for="item in counteStore.list" :key="item.id">{{ item }}</li>
      </ul>

    </div>

  <!-- <div>
    <input v-model="name" placeholder="请输入姓名">
    <input v-model="password" placeholder="请输入密码">
    <button @click="login">登录</button>
  </div> -->


  </div>  
  
</template>